{% load static %}
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}" />
	</head>
	<body>
		<div class="container">
			<div class="row">
				<h1 class="text-center">客户信息</h1>
				<div class="row">
					<div class="col-md-2">
						<input type="text" class="form-control" placeholder="请输入姓名">
					</div>
					<div class="col-md-2">
						<input type="number" class="form-control" placeholder="请输入手机号">
					</div>
					<div class="col-md-2">
						<button class="btn btn-primary">查询</button>
					</div>
					<button class="btn btn-success" style="float: right;"><a href="{% url 'add' %}" style="color:white">添加</a></button>
				</div>
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>客户名称</th>
							<th>手机号码</th>
							<th>录入时间</th>
							<th>业务员</th>
							<th>客户来源</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
                    {% for user in all_user %}
						<tr>
							<td>{{ user.C_name }}</td>
							<td>{{ user.C_phone }}</td>
							<td>{{ user.C_createtime |date:'Y-m' }}</td>
							<td>{{ user.A_id.A_name }}</td>
							<td>{{ user.S_id.S_name }}</td>
							<td>

								<button class="btn btn-warning"><a href="{% url 'edit' id=user.id%}" style="color:    white">编辑</a></button>
								<button class="btn btn-danger"><a href="{% url 'delete' id=user.id %}" style="color:    white">删除</a></button>
							</td>
						</tr>
                    {% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</body>
</html>
